<%@ Page language="vb" EnableViewStateMac="true" Inherits="_2bMatesSite.special_settings" CodeFile="special_settings.aspx.vb" CodeFileBaseClass="_2bMatesSite.BaseWebPage" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<form id="Form1" method="post" runat="server">
	<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" height="100%">
		<tr>
			<td colspan="3">
				<table cellspacing="0" cellpadding="0" width="100%" border="0" class="page_title" id="Table1">
					<tr>
						<td><asp:label id="lblTitle" runat="server">Creative Settings</asp:label></td>
						<td align="right"><asp:hyperlink id="hlBackToGroup" runat="server"  cssclass="white_link"></asp:hyperlink></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td valign="top" height="100%" class="main_table_border">
				<div class="content">
				<table border="0" cellpadding="0" cellspacing="0" width="100%" class="main_text">
					<tr>
						<td valign="top" align="left">
						<asp:literal id="litText" runat="server">
						Add yourself to our creative pages. On a weekly basis your profile will be picked and displayed for everyone to see.<br>
						If you have any relevant links and/or interesting ideas for these pages, email us at <a href="mailto:connect@2Bmates.com?subject=Creative Ideas" class="line">connect@2BMates.com</a>
						</asp:literal><br /><br />
						</td>
					</tr>
					<tr>									
						<td class="main_text_err" align="center" id="warning">
						<asp:literal id="litWarning" runat="server">
						<u>Warning:</u>&nbsp;&nbsp;Changing those settings may affect your appearance in "Music and Media" section
						</asp:literal>
						</td>
					</tr>
					<tr>
						<td vAlign="top" align="center">
							<ASP:DATAGRID id="dgSpecialSettings" runat="server" AllowSorting="False" CellPadding="0" PagerStyle-HorizontalAlign="Right"
								GridLines="None" AutoGenerateColumns="False">
								<ItemStyle CssClass="data_grid" VerticalAlign="Top"></ItemStyle>
								<HeaderStyle CssClass="data_grid_header"></HeaderStyle>
								<Columns>
									<asp:TemplateColumn>
										<HeaderStyle Width="30px"></HeaderStyle>
										<HeaderTemplate>
											<asp:CheckBox id="chkSelectAll" onclick="javascript:SelectAll(this.checked, this.id);showWarning(this);" runat="server" AutoPostBack="false" ToolTip="Select/Deselect All"></asp:CheckBox>
										</HeaderTemplate>
										<ItemTemplate>
											<asp:CheckBox id=chkSelect onclick="javascript: SelectAll(this.checked, this.id);showWarning(this);" runat="server" Checked='<%#DataBinder.Eval(Container.DataItem, "IsChecked") %>' value='<%# DataBinder.Eval(Container.DataItem, "CheckValue") %>'>
											</asp:CheckBox>
										</ItemTemplate>
										<FooterStyle HorizontalAlign="Left" VerticalAlign="Top"></FooterStyle>
									</asp:TemplateColumn>
									<asp:TemplateColumn HeaderText="Creative Page Name">
										<HeaderStyle Width="160px"></HeaderStyle>
										<ItemStyle CssClass="data_grid"></ItemStyle>
										<ItemTemplate>
											<asp:Label id=lblName runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "SpecialPageName") %>'>
											</asp:Label>
											<BR>
										</ItemTemplate>
									</asp:TemplateColumn>
								</Columns>
								<PagerStyle VerticalAlign="Top" Visible="False" HorizontalAlign="Right" Mode="NumericPages"></PagerStyle>
							</ASP:DATAGRID>
							<br>
							<br>
							<asp:Button id="btnUpdate" runat="server" Text="Update" CssClass="btn" onmouseover="ButtonMouseOver(this);" onmouseout="ButtonMouseOut(this);" onclick="btnUpdate_Click"></asp:Button></td>
					</tr>		
				</div>
			</td>
		</tr>
	</table>
</form>
<script language="JavaScript">
document.getElementById('warning').style.display = "none";
function SelectAll(chkVal, idVal) 
{
	var frm = document.forms[0];

	// Loop through all elements
	for (i=0; i<frm.length; i++) 
	{

		// Look for our Header Template's Checkbox
		if (idVal.indexOf ('SelectAll') != -1) 
		{
			// Check if main checkbox is checked, then select or deselect datagrid checkboxes 
			frm.elements[i].checked = chkVal;
			// Work here with the Item Template's multiple checkboxes
		}
		else if(idVal.indexOf ('chkSelect') != -1)
		{
			if(!chkVal){
				frm.elements[1].checked = chkVal;
			}	
		}
		else if (idVal.indexOf ('DeleteThis') != -1) 
		{
			// Check if any of the checkboxes are not checked, and then uncheck top select all checkbox
			if(frm.elements[i].checked == false) 
			{
				frm.elements[1].checked = false; //Uncheck main select all checkbox
			}
		}
	}
}

function showWarning(chk){
	if ( chk.checked == false ){
		var obj = document.getElementById('warning')
		obj.style.display = "block";
	}
}
</script>

